﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Deployment.Application;

namespace AL.Common
{
    public class Config
    {
        private static string _rootPath = string.Empty;
        // 程序根目录
        public static string RootPath
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_rootPath))
                {
                    var path = ApplicationDeployment.IsNetworkDeployed
                        ? ApplicationDeployment.CurrentDeployment.DataDirectory
                        : Environment.CurrentDirectory;

                    _rootPath = path;
                }
                return _rootPath;
            }
        }

        public static string DataPath
        {
            get
            {
                return string.Format("{0}/Data/", RootPath);
            }
        }

    }
}
